package day03;

public class HomeWork {
    public static void main(String[] args) {
        //作业1：算数 关系 逻辑 赋值 字符串连接
        //算数：
      /*  System.out.println(1+2);
        System.out.println(3-1);
        System.out.println(2*3);
        System.out.println(5/2);
        System.out.println(5%2);//商2 余1
        System.out.println(2%5);//2


       */

      //  int a=1,b=2;

        /*
        a++; //a=a+1
        b++;
        System.out.println(a);//2
        System.out.println(b);//3

         */
      /*
        a--;//a=a-1
        b--;
        System.out.println(a);//0
        System.out.println(b);//1

       */
        /*
        --a; //a=a-1
        --b;
        System.out.println(a);//0
        System.out.println(b);//1

         */

        //被使用:自增
       /*
        int c =a++;
        int d = ++b;//被使用，将++b的值3赋给d
        System.out.println(a);//2
        System.out.println(b);//3
        System.out.println(c);//1
        System.out.println(d);//3

        */

       /* int c = a--;//
        int d = --b;
        System.out.println(a);//0
        System.out.println(b);//1
        System.out.println(c);//1
        System.out.println(d);//1

        */

        /*
        //关系：> < >= <= == !=
        int a=2,b=3,c=1;
        System.out.println(a>b);//f
        System.out.println(b>c);//t
        System.out.println(a+b>c);//t
        System.out.println(a+c==b);//t
        System.out.println(a!=b);//t
        System.out.println(a+c!=b);//f

        System.out.println(a++>2);//f
        System.out.println(a++>2);//t 在上一步自增1

         */
      //  int a =5,b=10,c=5;
        /*
        boolean a1 = b>=a && a<b;
        System.out.println(a1);//t
        System.out.println(a<=b && a<=c);//t
        System.out.println(a>c && b<c);//f
        System.out.println(b!=c && b>c);//t
        System.out.println((c+a)==b && b!=c);//t

         */
/*
        // 演示||
        System.out.println(b>a || c>b);//t||f =t
        System.out.println((c+a)==b || b>a);//t+t=t
        System.out.println(b!=a ||a>a+b);//t ||f=t
        System.out.println(b==a || a<=c);//f ||f=t

        //演示！
        System.out.println(!(a>b));//非f=t
        System.out.println(!(c<b));//非t=f


 */


    //    int a=5,b =10,c=5;
    /*
        boolean b3 = a>b && c++>2;
        System.out.println(b3);//f
        System.out.println(c);//5发生短路，c不运算

        boolean b4  = a<b && c++>2;
        System.out.println(b4);//t
        System.out.println(c);//6 没发生短路，c参与运算
      */

/*
        boolean a1 =a>=c || b++>a;
        System.out.println(a1);//t
        System.out.println(b);//10 或（true）发生短路 后面不运行
        boolean a2 =a<c || b++>a;
        System.out.println(a2);//t
        System.out.println(b);//11a<c为f，没有短路


 */



        //赋值
//        int a =5,b=2,c=4;
 //       a +=5;//a=（int）(a+5)
   //     b -=1;//b=(int)(b-1)
  //      c *=2;//c=(int)(c*2)
//       System.out.println(a);//10
 //       System.out.println(b);//1
  //      System.out.println(c);//8
/*
        a *=2;//20
        System.out.println(a);
        a /=4;
        System.out.println(a);//5

 */
        /*
        short s = 5;
       // s =s+5;错误，需要强转换 s+5是int类型，大赚小要强制
        s +=5;

         */

        //字符串连接：
        /*
        int age =18;
        System.out.println("我的年龄为"+age);
        System.out.println(100+20+" ");//120
        System.out.println(""+10+20);//1020
        System.out.println(10+""+20);//1020

         */


        //条件：
       /*
        int num =10;
        int a =num>20? 1:-1;
        System.out.println(a);//-1
        int b = num>8?23:666;
        System.out.println(b);//23

        int c = 100,d=90;
        int max =c>d?c:d;
        System.out.println("max="+max);//max=100

        */

        //if
    /*
        //，满300打99折
        int a = 200;
        if (a>=300){
            a *=0.99;
            System.out.println("需要支付"+a+"元");
        }
        System.out.println("000000000000");
        //成绩90以上有奖励
        int score =99;
        if (score>=90){
            System.out.println("奖励10元");
        }
        System.out.println("------");

     */


        //if else
        //成绩满80奖励20元，否则不奖励
      /*
        int score =88;
        if (score>=80){
            System.out.println("奖励20元");

        }else {
            System.out.println("没有奖励");
        }

        //消费满200减20元，否则不减
        double money=120;
        if (money>=200){
            money -=20;
            System.out.println("消费金额为："+money);
        }else {
            System.out.println("消费金额为"+money);
        }

       */


/*
        //扩展：1.
        int a=1,b=10;
        int max =a>b?a:b;
        System.out.println("max="+max);

        if (a>b){
            System.out.println("最大是"+a);
        }else {
            System.out.println("最大值是"+b);
        }

 */

      /*
        //扩展2;
        int year=2024;
        if (year%4==0 && year%100!=0){
            System.out.println(year+"是闰年");
        }else if (year/400==0){
            System.out.println(year+"是闰年");
        }else {
            System.out.println(year+"不是闰年");
        }

       */


        //3.
        int score =50;
        if (score<0 && score>100){
            System.out.println("成绩不合法");
        } else if (score>=90) {
            System.out.println("成绩为："+score+"成绩优秀");
        } else if (score>=80) {
            System.out.println("成绩为："+score+"成绩优");
        }else if (score>=60){
            System.out.println("成绩为："+score+"成绩良好");
        }else {
            System.out.println("成绩为："+score+"成绩差");
        }


    }
}
